﻿using System;
using UnityEngine;
using UnityEngine.UI;

[ExecuteInEditMode]
public class SetFontFilterMode : MonoBehaviour
{
    public FilterMode mode;

    [ContextMenu("Set")]
    private void OnEnable()
    {
        Text component = base.GetComponent<Text>();
        if (component != null)
        {
            component.font.material.mainTexture.filterMode = this.mode;
        }
        TextMesh mesh = base.GetComponent<TextMesh>();
        if (mesh != null)
        {
            mesh.font.material.mainTexture.filterMode = this.mode;
        }
    }
}

